<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>变换边框</title>
    <style>
        @keyframes xz{
            0%{
                transform: rotate(0);
            }
            100%{
                transform: rotate(360deg);
            }
        }
        .bi{
            position: relative;
            width: 300px;
            height: 200px;
            margin: 100px auto;
            overflow: hidden;
        }
        .bi::before{
            position: absolute;
            content: "";
            display: block;
            width: 96%;
            height: 96%;
            background: white;
            left: 2%;
            top: 2%;
            z-index: 50;
        }
        .c1,.c2,.c3,.c4{
            width: 150px;
            height: 100px;
            float: left;
        }
        .c1{
            transform-origin: bottom right;
            background: pink;
            animation: xz 3s linear infinite;
        }
        .c2{
            transform-origin: bottom left;
            background: skyblue;
            animation: xz 3s linear infinite;
        }
        .c3{
            background: springgreen;
            transform-origin: top right;
            animation: xz 3s linear infinite;
        }
        .c4{
            background: orchid;
            transform-origin: top left;
            animation: xz 3s linear infinite;
        }
    </style>
</head>
<body>
    <div class="bi">
        <div class="c1"></div>
        <div class="c2"></div>
        <div class="c3"></div>
        <div class="c4"></div>
    </div>
</body>
</html>